/**
 * @(#) InrecFacade.as
 *
 * @date		2012. 11. 07.
 * @version		1.0
 * @author		Park, Jutae
 * @description	module facade (사내추천 신청)
 * 				mvc간 주고 받는 메세지를 정의하고,  command를 등록한다. 
 */
package com.skt.common_hr.nametag
{
	import com.skt.common_hr.nametag.controller.StartupCommand;
	import com.skt.common_hr.common.puremvc.CommonFacade;
	
	import flash.display.DisplayObject;
	
	public class NametagFacade extends CommonFacade
	{
		public static const STARTUP:String 						= 'startup';
		public static const CLOSE_MODULE:String					= 'closeModule';
		public static const WRITEVIEW_LIST_COMPLETE:String		= "WRITEVIEW_LIST_COMPLETE";
		public static const WRITEVIEW_LIST_FAILED:String		= "WRITEVIEW_LIST_FAILED";
		public static const LOAD_CBLIST_COMPLETE:String			= "LOAD_CBLIST_COMPLETE";
		public static const LOAD_CBLIST_FAILED:String			= "LOAD_CBLIST_FAILED";
		public static const SAVE_COMPLETE:String				= "SAVE_COMPLETE";
		public static const SAVE_FAILED:String					= "SAVE_FAILED";
		public static const READ_LIST_COMPLETE:String			= "readlistcomplete";
		public static const READ_LIST_FAILED:String				= "readlistfailed";
		public static const WRITEVIEW_LIST_COMPLETE2:String		= "WRITEVIEW_LIST_COMPLETE2";
		public static const WRITEVIEW_LIST_FAILED2:String		= "WRITEVIEW_LIST_FAILED2";
		
		
		
		
		
		public static const LOAD_LIST_COMPLETE:String			= "loadListComplete";
		public static const LOAD_LIST_FAILED:String				= "loadFailed";
		public static const LOAD_CODES_COMPLETE:String			= "loadCodesComplete";
		public static const LOAD_CODES_FAILED:String			= "loadCodesFailed";
		public static const LOAD_WORKPLACE_COMPLETE:String		= "loadWorkplaceComplete";
		public static const LOAD_WORKPLACE_FAILED:String		= "loadWorkplaceFailed";
		
		public static const UPDATE_COMPLETE:String				= "updateComplete";
		public static const UPDATE_FAILED:String				= "updateFailed";
		public static const DELETE_COMPLETE:String				= "deleteComplete";
		public static const DELETE_FAILED:String				= "deleteFailed";
		
		public static const LOAD_READ_COMPLETE:String			= "LOAD_READ_COMPLETE";
		public static const LOAD_READ_FAILED:String				= "LOAD_READ_FAILED";
		public static const LOAD_CONDOCB_COMPLTE:String			= "LOAD_CONDOCB_COMPLTE";
		public static const LOAD_CONDOCB_FAILED:String			= "LOAD_CONDOCB_FAILED";
		public static const LOAD_AREACB_COMPLTE:String			= "LOAD_AREACB_COMPLTE";
		public static const LOAD_AREACB_FAILED:String			= "LOAD_AREACB_FAILED";
		public static const LOAD_ROOMSCB_COMPLTE:String			= "LOAD_ROOMSCB_COMPLTE";
		public static const LOAD_ROOMSCB_FAILED:String			= "LOAD_ROOMSCB_FAILED";
		public static const LOAD_BUSINESSCB_COMPLTE:String		= "LOAD_BUSINESSCB_COMPLTE";
		public static const LOAD_BUSINESSCB_FAILED:String		= "LOAD_BUSINESSCB_FAILED";
		public static const LOAD_PROFILE_COMPLETE:String		= "LOAD_PROFILE_COMPLETE";
		public static const LOAD_PROFILE_FAILED:String			= "LOAD_PROFILE_FAILED";
		public static const OK_REQUEST_INPUT:String				= "okRequestInput";
		public static const CANCEL_REQUEST_INPUT:String			= "canelRequestInput";
		
		
		public function NametagFacade( key:String )
		{
			super(key);	
		}
		
        /**
         * Singleton ApplicationFacade Factory Method
         */
        public static function getInstance( key:String ) : NametagFacade 
        {
            if ( instanceMap[ key ] == null ) instanceMap[ key ] = new NametagFacade( key );
            return instanceMap[ key ] as NametagFacade;
        }

        /**
         * Register Commands with the Controller 
         *     - parent 클래스의 생성자에서 자동으로 호출됨
         */
        override protected function initializeController( ) : void {
            super.initializeController();            
            registerCommand( STARTUP, StartupCommand);
        }
       
        /**
         * Module의 시작점으로 Pacdp.mxml의 creationComplete 이벤트에서 호출한다.
         *     
         */
        public function startup(app:Object) :void 
        {
        	trace("send startup in Pacdp");
        	this.app = app as DisplayObject;
            sendNotification( STARTUP, app );
        }
		
	}
}